package com.beyondsoft.sabg.edu.service.impl;

import com.beyondsoft.sabg.edu.model.db.DocumentContent;
import com.beyondsoft.sabg.edu.repository.DocumentContentRepo;
import com.beyondsoft.sabg.edu.service.DocumentContentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class DocumentContentServiceImpl extends AbstractSimpleServiceImpl<DocumentContent, DocumentContentRepo> implements DocumentContentService {

    @Override
    public List<DocumentContent> findByDocumentType(String documentType) {
        return this.getRepo().findByDocumentTypeOrderByCreatedTimeDesc(documentType);
    }

    @Override
    public List<DocumentContent> findByTitleContaining(String title) {
        return this.getRepo().findByTitleContainingOrderByCreatedTimeDesc(title);
    }
} 